#! /bin/csh
# This script is to execute a given program by enumerating the program's 
# parameters and the environment variables needed by the program.
# The program must reside within the same directory with this script
#
# The program name, say pn, is given as the parameter of this script
# e.g. ./exec pn
#
if ($#argv < 1) then
	echo "Must specify program name!"
	exit 1
endif
rm -f res_$1
rm -f output_$1
foreach n (100 200 500 1000 2000 5000 10000)
	foreach thread_num (1 2 4 8 10 12 14 15 16)
		env OMP_NUM_THREADS=$thread_num OMP_DYNAMIC=FALSE ./$1 $n res_$1 >> output_$1
	end
end

